<?php

namespace app\uniapp\service;

use app\model\store\OrderRefund;
use app\uniapp\service\traits\InstanceTrait;
use think\db\Query;

class OrderRefundService extends UniBaseService
{

    use InstanceTrait;

    function initialize()
    {
        $this->model = new OrderRefund();
    }

    function formatData(array $data): array
    {
        return $data;
    }

    public function query(): Query
    {
        return $this->setWith(['items'])->makeQuery()->filter(function ($v) {
            $v->refundAddress = unserialize($v->refund_address);
        });
    }
}
